public class panduansushu{
	public static boolean isSushu(int num){
		if(num<=1){
			return false;
		}
		if(num==2){
			return true;
		}
		if(num%2==0){
			return false;
		}
		for(int i=3;i<=Math.sqrt(num);i+=2){
			if(num%i==0){
				return false;
			}
		}
		return true;
	}

	public static void main(String[] args){
		int count=0;
		for(int num=2;num<=20000;num++){
			if(isSushu(num)){
				System.out.print(num+"\t");
				count++;
				if(count%5==0){
					System.out.println();
				}
			}
		}
	}
}